<template>
  <div class="my-container">
    <van-cell-group class="my-info">
      <van-cell class="base-info" :border="false">
        <van-image
          class="avatar"
          slot="icon"
          round
          fit="cover"
          src="https://img.yzcdn.cn/vant/cat.jpeg"
        />
        <div class="name" slot="title">昵称</div>
        <van-button class="update-btn" size="small" round>编辑资料</van-button>
      </van-cell>

      <van-grid class="data-info" :border="false">
        <van-grid-item class="data-info-item">
          <div class="text-wrap">
            <div class="count">123</div>
            <div class="text">头条</div>
          </div>
        </van-grid-item>

        <van-grid-item class="data-info-item">
          <div class="text-wrap">
            <div class="count">123</div>
            <div class="text">关注</div>
          </div>
        </van-grid-item>

        <van-grid-item class="data-info-item">
          <div class="text-wrap">
            <div class="count">123</div>
            <div class="text">粉丝</div>
          </div>
        </van-grid-item>

        <van-grid-item class="data-info-item">
          <div class="text-wrap">
            <div class="count">123</div>
            <div class="text">获赞</div>
          </div>
        </van-grid-item>
      </van-grid>
    </van-cell-group>

    <van-grid class="nav-grid" :border="false" :column-num="2">
      <van-grid-item icon="star-o" text="收藏" />
      <van-grid-item icon="clock-o" text="历史" />
    </van-grid>

    <van-cell title="消息通知" is-link to="/" />
    <van-cell class="mb-4" title="小智同学" is-link to="/" />

    <van-cell class="logout-cell" title="退出登录" @click="doExitLogin" />

  </div>
</template>

<script>
export default {
  name: "myIndex",
  props: {},
  data() {
    return {
      count: 0,
      isLoading: false
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    doExitLogin() {
      this.$dialog.confirm({
        title: "退出提示",
        message: "您确认要退出吗？"
      })
        .then(() => {
          // on confirm
          alert('退出成功');
        })
        .catch(() => {
          // on cancel
          alert("取消成功")
        });
    }
  }
};
</script>

<style scoped lang="less">
.my-container {
  .my-info {
    overflow: hidden;
    // background: url("../../assets/logo.png") no-repeat;
    background-color: skyblue;
    background-size: cover;
    .base-info {
      box-sizing: border-box;
      margin-top: 116px;
      padding: 0 30px 0 30px;
      height: 132px;
      background-color: transparent;
      border: 0;

      .avatar {
        box-sizing: border-box;
        border: 1px solid #fff;
        width: 130px;
        height: 130px;
        border-radius: 50%;
      }

      .name {
        color: #fff;
        margin-left: 20px;
        line-height: 140px;
        font-size: 40px;
      }

      .update-btn {
        position: relative;
        top: 50%;
        transform: translate(0, -90%);
        height: 33px;
        font-size: 20px;
        color: #666666;
      }
    }

    .data-info {
      padding: 0 30px 0 30px;
      .data-info-item {
        height: 130px;
        color: #fff;
        /deep/.van-grid-item__content {
          padding: 0;
          background-color: transparent;
        }

        .text-wrap {
          display: flex;
          flex-direction: column;
          justify-content: center;
          align-items: center;

          .count {
            font-size: 40px;
          }
          .text {
            font-size: 26px;
          }
        }
      }
    }
  }

  .nav-grid {
    height: 144px;
    /deep/.van-grid-item__text {
      font-size: 28px;
    }
    .van-grid-item:nth-child(1) {
      color: #eb5253;
    }
    .van-grid-item:nth-child(2) {
      color: #ff9d1d;
    }
  }

  .logout-cell {
    text-align: center;
    color: #d86262;
  }
  .mb-4 {
    margin-bottom: 4px;
  }
}
</style>